/*
 * Copyright (c) 2017. danlu.com Co.Ltd. All rights reserved.
 */

package cn.com.dhc.danlu.dlware.global;

import android.content.Context;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;

/**
 * 丹露用Application
 *
 * @author MuWei
 * @version 1.00 2015/02/02 新建
 */
public class DanluApplication extends MultiDexApplication {
    public static GlobalApiAgent agent = new GlobalApiAgent ();
    private static DanluApplication application;
//    private RefWatcher refWatcher;

    public static DanluApplication get () {
        return application;
    }

//    public static RefWatcher getReWatcher () {
//        return get ().refWatcher;
//    }

    @Override
    protected void attachBaseContext (Context base) {
        super.attachBaseContext (base);
        MultiDex.install (this);
        application = this;
    }

    @Override
    public void onCreate () {
        super.onCreate ();

        // 检测LeakCanary进程服务器是否存在
//        if (LeakCanary.isInAnalyzerProcess (this)) {
//            return;
//        }
//        refWatcher = LeakCanary.install (this);

        agent.onCreate ();
    }

    @Override
    public void onTerminate () {
        super.onTerminate ();
    }
}
